home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - Speed tweak to maximize your bandwidth. Windows 2000 and XP (TXT, REG).zip / IntSpeed.hta next >
Text File  |  2002-04-23  |  8KB  |  216 lines

  1. <HTML>
  2. <HEAD>
  3.  
  4. <HTA:APPLICATION TITLE="PC Pitstop AutoFix" SINGLEINSTANCE=YES STATUSBAR=YES>
  5. <SCRIPT>
  6. //
  7. // ==> Are you READING this AutoFix but wanted to RUN it?  <==
  8. // ==> See http://www.pcpitstop.com/pcpitstop/AutoFix.htm  <==
  9. //
  10. // Copyright (c) 2000 PC Pitstop, LLC. All rights reserved.
  11. //
  12.  
  13. // globals
  14. var wsh = new ActiveXObject("WScript.Shell");
  15. var TCPKEY, TCPTYPE;
  16. var OSVERSION = GetWindowsVersion();
  17.  
  18. // Center and size window on screen
  19. var sw = window.screen.width;
  20. var sh = window.screen.height;
  21. var ww = Math.min(sw-50,  600);
  22. var wh = Math.min(sh-100, 500);
  23. window.moveTo((sw-ww)/2,(sh-wh)/2);
  24. window.resizeTo(ww,wh);
  25.  
  26. function ShowDiv(id, visible, text)
  27. {
  28.     if ( typeof(text) != "undefined" )
  29.         document.all[id].innerHTML = text;
  30.     document.all[id].style.display = visible? "" : "none";
  31. }
  32.  
  33. function GetWindowsVersion()
  34. {
  35.     var KEY9X = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\";
  36.     var osname = "?", osver = "?", ossp = "";
  37.     try { osname = wsh.RegRead(KEY9X+"Version") } catch(err) {}
  38.     if ( osname != "?" ) {    // Win9x
  39.         osname = osname.replace(/Millennium Edition/, "Me");
  40.         try { osver = wsh.RegRead(KEY9X+"VersionNumber") } catch(err) {}
  41.     }
  42.     else {    // NT or 2000
  43.         var KEYNT = "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\";
  44.         try { osver = wsh.RegRead(KEYNT+"CurrentVersion") } catch(err) {}
  45.         osname = "Windows " + ((parseInt(osver.substr(0,1)) >= 5)? "2000" : "NT");
  46.         var KEYSP = "HKLM\\System\\CurrentControlSet\\Control\\Windows\\";
  47.         try { ossp = wsh.RegRead(KEYSP+"CSDVersion") } catch(err) {}
  48.         if ( ossp ) {
  49.             ossp = " " + ossp.toString(16).replace(/^(\d)00/, "SP$1");
  50.         } else {
  51.             ossp = "";
  52.         }
  53.     }
  54.     //alert("osname="+osname+"  osver="+osver+"  ossp="+ossp);
  55.     return osname+" "+osver+ossp;
  56. }
  57.  
  58. function SetWin(rwin)
  59. {
  60.     ShowDiv("ChangeText", 0);
  61.     try {
  62.         if ( rwin != 0 ) {
  63.             wsh.RegWrite(TCPKEY, rwin, TCPTYPE);
  64.         }
  65.         else {
  66.             try { 
  67.                 wsh.RegRead(TCPKEY);    // fails if no key
  68.                 wsh.RegDelete(TCPKEY);
  69.             } catch(err) {}
  70.         }
  71.         ShowDiv("UpdateComplete", 1);
  72.     } catch(err) {
  73.         document.all["errnumber"].innerText = err.number;
  74.         document.all["errstring"].innerText = err.description;
  75.         ShowDiv("UpdateFailed", 1);
  76.     }
  77. }
  78.  
  79. function main()
  80. {
  81.     // Get current window size, depending on OS
  82.     if ( OSVERSION.match(/^Windows (95|98|Me)/) ) {
  83.         TCPKEY = "HKLM\\System\\CurrentControlSet\\Services\\VxD\\MSTCP\\DefaultRcvWindow";
  84.         TCPTYPE = "REG_SZ";
  85.     } else if ( OSVERSION.match(/^Windows (NT|2000)/) ) {
  86.         TCPKEY = "HKLM\\System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\TcpWindowSize"
  87.         TCPTYPE = "REG_DWORD";
  88.     } else {
  89.         alert("This AutoFix has not been tested on "+OSVERSION);
  90.         window.close();
  91.     }
  92.     var rwin = "(default)";
  93.     try { rwin = wsh.RegRead(TCPKEY) } catch(err) {}
  94.     document.all["RxBufSize"].innerHTML = rwin;
  95.     ShowDiv("ChangeText", 1);
  96. }
  97.  
  98. </SCRIPT>
  99.  
  100. <STYLE>
  101. body  {background-color:white; FONT-FAMILY: Arial, Helvetica, sans serif;}
  102.  
  103. h1    { font: 150% Arial,helvetica, sans-serif; color: darkblue; margin-top: 1ex; margin-bottom: 0ex }
  104. h2    { font: 120% Arial,helvetica, sans-serif; color: darkblue; margin-top: 2ex; margin-bottom: 1ex }
  105. h3    { font: 100% Arial,helvetica, sans-serif; color: darkblue; margin-top: 1ex; margin-bottom: 0.5ex }
  106. h4    { font:  60% Arial,helvetica, sans-serif; color: darkblue; margin-top: 0ex; margin-bottom: 0ex }
  107. table { horizontal-align: center }
  108. th    { background-color: #CCE; padding: 4px }
  109. td    { background-color: #EEF; padding: 8px }
  110. .err  { color: red }
  111. p     {font-size:80%}
  112. .list {font-size:80%}
  113. A:link {COLOR: #330099}
  114. A:active  {COLOR: #cc0033}
  115. A:visited  {COLOR: #330099}
  116.  
  117. </STYLE>
  118.  
  119. </HEAD>
  120. <BODY onLoad="main()">
  121.  
  122. <h1>PC Pitstop Internet Speed AutoFix</h1>
  123. <h4>Copyright ⌐ 2000 <a href="http://www.pcpitstop.com">PC Pitstop</a>.
  124. Visit the <a href="http://www.pcpitstop.com/internetcenter.asp">PC Pitstop Internet Center</a> for more information.</h4>
  125.  
  126. <DIV ID="ChangeText" style="DISPLAY: none">
  127. <p>If you have a high-speed Internet connection such as a DSL line or cable modem, this AutoFix may be able to increase your Internet speed. Here is a summary of your current configuration and our suggested settings:
  128. <p>
  129. <span style="font-size:small"><b>Current Receive Buffer Size: <span style="color:#339966" id="RxBufSize">(default)</span></b></span>
  130. </p>
  131.  
  132. <table cellpadding=8 cellspacing=0>
  133. <tr>
  134. <th>Option</th>
  135. <th>Description</th>
  136. </tr>
  137. <tr>
  138. <td valign=top align=middle><input type=button style="background-color:#ffffcc" value="Typical Latency" onClick="SetWin(64240)"></td>
  139. <td valign=top>
  140. <p>This is the most common case for cable modems, DSL, or satellite connections.  Use this setting if your ping times are often greater than 100ms. It will set the receive buffer size to 64240. 
  141. </td>
  142. </tr>
  143. <tr>
  144. <td valign=top align=middle><input type=button style="background-color:#ffffcc" value="   Low Latency   " onClick="SetWin(32120)"></td>
  145. <td valign=top>
  146. <p>Use this setting if ping times to your most commonly used sites are usually less than 100ms, or if your connection experiences high ping losses. It will set the receive buffer size to 32120. Some cable modem or DSL users may find this setting provides better performance.
  147. </td>
  148. </tr>
  149. <tr>
  150. <td valign=top align=middle><input type=button style="background-color:#ffffcc" value=" Default Values " onClick="SetWin(0)"></td>
  151. <td valign=top>
  152. <p>This removes any manually-set receive buffer size so that Windows uses its default values. 
  153. </td>
  154. </tr>
  155. <tr>
  156. <td valign=top align=middle><input type=button style="background-color:#ffffcc" value="   No Changes   " onClick="window.close()"></td>
  157. <td valign=top>
  158. <p>Exit this AutoFix without making any changes.
  159. </td>
  160. </tr>
  161. </table>
  162. <p><font color=blue><EM>Note:</EM> If you use this AutoFix and later want to undo the
  163. changes, simply run the AutoFix again and click the Default Values button.</font>
  164. <h2>More Information</h2>
  165.  
  166. <p>
  167. This AutoFix adjusts the network receive buffer size, which is the most important setting for good performance with a cable modem or DSL connection. In most cases it is the <i>only</i> value you should need to adjust. If your Internet performance is still dismal and you want to experiment more, you may want to try one of these resources:
  168. </p>
  169.  
  170. <ul class="list">
  171. <li><a href="http://www.speedguide.net/Cable_modems/cable_patches.shtml">SpeedGuide</a>
  172. <li><a href="http://www.hms.com/default.asp">iSpeed</a>
  173. <li><a href="http://www.rosecitysoftware.com/TweakDUN/">TweakDUN</a></li>
  174. </ul>
  175. <p>
  176. To determine your ping times or bandwidth performance, visit the
  177. <a href="http://www.pcpitstop.com/internetcenter.asp">PC Pitstop Internet Center</a>.
  178. </p>
  179. </DIV>
  180. <br>
  181. <DIV ID="UpdateComplete" style="DISPLAY: none">
  182.  
  183. <font size="+1" color=#339966>Update Complete!</font>
  184. <p>
  185. <STRONG>Your Internet settings were successfully updated. </STRONG>
  186. </p>
  187.  
  188.     <font color=red size="-1">
  189.     <b><i>Note:</i> You must restart Windows before the new settings will take effect.</b>
  190.     </font>
  191.  
  192. <p >
  193. <input type=button style="background-color:#ffffcc" value="Close" onClick="window.close()"></p>
  194. </DIV>
  195. <p> </p>
  196.  
  197. <DIV ID="UpdateFailed" style="DISPLAY: none">
  198.  
  199. <font size="+1" color=red>Update Failed!</font>
  200. <p>
  201. <STRONG>The AutoFix was unable to update the registry settings.</STRONG>
  202. </p>
  203. Error number: <span id=errnumber></span><br>
  204. Description: <span id=errstring></span><br>
  205. <script>
  206. if ( OSVERSION.match(/^Windows (NT|2000)/) ) {
  207.  document.write("<p><b>Make sure you are using an account that has Administrator privileges. They are needed to make the required registry changes.</b></p>");
  208. }
  209. </script>
  210.  
  211. </DIV>
  212.  
  213. </BODY>
  214. </HTML>
  215.  
  216.